home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 April / PCWorld_1999-04_cd.bin / Software / Vyzkuste / LearnVB5 / VB Code / Class 3 / Example3-3.frm (.txt) < prev    next >
Visual Basic Form  |  1998-04-14  |  4KB  |  126 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFlight 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Flight Planner"
  5.    ClientHeight    =   3465
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1515
  8.    ClientWidth     =   6150
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   3465
  14.    ScaleWidth      =   6150
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton cmdExit 
  17.       Caption         =   "E&xit"
  18.       Height          =   495
  19.       Left            =   3240
  20.       TabIndex        =   7
  21.       Top             =   2760
  22.       Width           =   1215
  23.    End
  24.    Begin VB.CommandButton cmdAssign 
  25.       Caption         =   "&Assign"
  26.       Height          =   495
  27.       Left            =   1680
  28.       TabIndex        =   6
  29.       Top             =   2760
  30.       Width           =   1215
  31.    End
  32.    Begin VB.ComboBox cboMeal 
  33.       Height          =   1740
  34.       Left            =   4200
  35.       Style           =   1  'Simple Combo
  36.       TabIndex        =   2
  37.       Top             =   600
  38.       Width           =   1815
  39.    End
  40.    Begin VB.ComboBox cboSeat 
  41.       Height          =   315
  42.       Left            =   2280
  43.       Style           =   2  'Dropdown List
  44.       TabIndex        =   1
  45.       Top             =   600
  46.       Width           =   1815
  47.    End
  48.    Begin VB.ListBox lstCities 
  49.       Height          =   2010
  50.       Left            =   120
  51.       Sorted          =   -1  'True
  52.       TabIndex        =   0
  53.       Top             =   600
  54.       Width           =   2055
  55.    End
  56.    Begin VB.Label Label3 
  57.       Caption         =   "Meal Preference"
  58.       Height          =   375
  59.       Left            =   4200
  60.       TabIndex        =   5
  61.       Top             =   120
  62.       Width           =   1215
  63.    End
  64.    Begin VB.Label Label2 
  65.       Caption         =   "Seat Location"
  66.       Height          =   375
  67.       Left            =   2280
  68.       TabIndex        =   4
  69.       Top             =   120
  70.       Width           =   1215
  71.    End
  72.    Begin VB.Label Label1 
  73.       Caption         =   "Destination City"
  74.       Height          =   375
  75.       Left            =   120
  76.       TabIndex        =   3
  77.       Top             =   120
  78.       Width           =   1215
  79.    End
  80. Attribute VB_Name = "frmFlight"
  81. Attribute VB_GlobalNameSpace = False
  82. Attribute VB_Creatable = False
  83. Attribute VB_PredeclaredId = True
  84. Attribute VB_Exposed = False
  85. Private Sub cmdAssign_Click()
  86. 'Build message box that gives your assignment
  87. Dim Message As String
  88. Message = "Destination: " + lstCities.Text + vbCr
  89. Message = Message + "Seat Location: " + cboSeat.Text + vbCr
  90. Message = Message + "Meal: " + cboMeal.Text + vbCr
  91. MsgBox Message, vbOKOnly + vbInformation, "Your Assignment"
  92. End Sub
  93. Private Sub cmdExit_Click()
  94. End Sub
  95. Private Sub Form_Load()
  96. 'Add city names to list box
  97. lstCities.Clear
  98. lstCities.AddItem "San Diego"
  99. lstCities.AddItem "Los Angeles"
  100. lstCities.AddItem "Orange County"
  101. lstCities.AddItem "Ontario"
  102. lstCities.AddItem "Bakersfield"
  103. lstCities.AddItem "Oakland"
  104. lstCities.AddItem "Sacramento"
  105. lstCities.AddItem "San Jose"
  106. lstCities.AddItem "San Francisco"
  107. lstCities.AddItem "Eureka"
  108. lstCities.AddItem "Eugene"
  109. lstCities.AddItem "Portland"
  110. lstCities.AddItem "Spokane"
  111. lstCities.AddItem "Seattle"
  112. lstCities.ListIndex = 0
  113. 'Add seat types to first combo box
  114. cboSeat.AddItem "Aisle"
  115. cboSeat.AddItem "Middle"
  116. cboSeat.AddItem "Window"
  117. cboSeat.ListIndex = 0
  118. 'Add meal types to second combo box
  119. cboMeal.AddItem "Chicken"
  120. cboMeal.AddItem "Mystery Meat"
  121. cboMeal.AddItem "Kosher"
  122. cboMeal.AddItem "Vegetarian"
  123. cboMeal.AddItem "Fruit Plate"
  124. cboMeal.Text = "No Preference"
  125. End Sub
  126.